package com.hzdesk.media.koreabatchmatvector.logic.persenter;

import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;

import com.hzdesk.media.koreabatchmatvector.adapter.MouseListAdapter;
import com.hzdesk.media.koreabatchmatvector.config.RxBusUtil;
import com.hzdesk.media.koreabatchmatvector.inter.OnMouseListItemClickListener;
import com.hzdesk.media.koreabatchmatvector.logic.contract.MouseListContract;

/**
 * Created by Administrator on 2018/7/10.
 * 杭州席媒科技有限公司  Developers  刘传华  10
 * 佛祖镇楼 bug辟易
 */

public class MouseListPersenter implements MouseListContract.IMouseListPersenter {
    private MouseListContract.IMouseListView mIMouseListView;

    public MouseListPersenter(MouseListContract.IMouseListView mIMouseListView) {
        this.mIMouseListView = mIMouseListView;
    }

    @Override
    public void initDate(RecyclerView recyclerView, Context mContext) {
        MouseListAdapter adapter = new MouseListAdapter(mContext);
        LinearLayoutManager layoutmanager = new LinearLayoutManager(mContext);
        layoutmanager.setOrientation(LinearLayoutManager.VERTICAL);
        recyclerView.setLayoutManager(layoutmanager);
        adapter.setOnMouseListItemClickListener(new OnMouseListItemClickListener() {
            @Override
            public void OnItemClick(int position) {
                mIMouseListView.toMouseSetPager(position);
            }
        });
        recyclerView.setAdapter(adapter);
    }

    @Override
    public void oncklicedBack() {
        mIMouseListView.toFinshPager();
    }
}
